package com.anywhere.freightman.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "beidou", url = "${car.location.beidou.host-name}")
public interface BeidouClient {

    @PostMapping("StandardApiAction_login.action")
    String getToken(@RequestParam("account") String account,
                    @RequestParam("password") String password);

    @PostMapping("StandardApiAction_getDeviceByVehicle.action")
    String getDeviceId(@RequestParam("jsession") String token,
                       @RequestParam("vehiIdno") String carNumber);

    @PostMapping("StandardApiAction_getDeviceOlStatus.action")
    String getCarStatus(@RequestParam("jsession") String token,
                        @RequestParam("vehiIdno") String carNumber);

    @PostMapping("StandardApiAction_vehicleStatus.action")
    String getLastLocation(@RequestParam("jsession") String token,
                           @RequestParam("vehiIdno") String carNumber,
                           @RequestParam("toMap") int mapType);

    @PostMapping("StandardApiAction_queryTrackDetail.action")
    String getCarTrackDetail(@RequestParam("jsession") String token,
                             @RequestParam("devIdno") String deviceId,
                             @RequestParam("begintime") String beginTime,
                             @RequestParam("endtime") String endTime,
                             @RequestParam("toMap") int mapType);
}
